@@ -68,7 +68,7 @@ class BrandInfoAdmin(admin.ModelAdmin): |
||
| 68 | 68 |
class ModelInfoAdmin(AdvancedExportExcelModelAdmin, DeleteModelAdmin, admin.ModelAdmin): |
| 69 | 69 |
list_display = ('pk', 'brand_id', 'brand_name', 'jancode', 'model_id', 'model_name', 'model_uni_name', 'model_full_name', 'model_descr', 'image', 'url', 'image2', 'integral', 'position', 'display', 'is_important', 'shot_type_id', 'shot_member_integral', 'shot_member_image', 'shot_member_name', 'status', 'created_at', 'updated_at')
|
| 70 | 70 |
list_filter = ('brand_name', 'shot_type_id', 'display', 'status')
|
| 71 |
- readonly_fields = ('brand_name', 'factory_fee')
|
|
| 71 |
+ readonly_fields = ('brand_name', )
|
|
| 72 | 72 |
search_fields = ('brand_id', 'brand_name', 'jancode', 'model_id', 'model_name', 'model_uni_name', 'model_full_name', 'model_descr')
|
| 73 | 73 |
|
| 74 | 74 |
def save_model(self, request, obj, form, change): |
@@ -0,0 +1,36 @@ |
||
| 1 |
+# -*- coding: utf-8 -*- |
|
| 2 |
+ |
|
| 3 |
+# Generated by Django 3.2.6 on 2023-02-08 05:44 |
|
| 4 |
+ |
|
| 5 |
+from django.db import migrations, models |
|
| 6 |
+ |
|
| 7 |
+ |
|
| 8 |
+class Migration(migrations.Migration): |
|
| 9 |
+ |
|
| 10 |
+ dependencies = [ |
|
| 11 |
+ ('mch', '0065_auto_20221118_1657'),
|
|
| 12 |
+ ] |
|
| 13 |
+ |
|
| 14 |
+ operations = [ |
|
| 15 |
+ migrations.RemoveField( |
|
| 16 |
+ model_name='modelinfo', |
|
| 17 |
+ name='category', |
|
| 18 |
+ ), |
|
| 19 |
+ migrations.RemoveField( |
|
| 20 |
+ model_name='modelinfo', |
|
| 21 |
+ name='factory_fee', |
|
| 22 |
+ ), |
|
| 23 |
+ migrations.RemoveField( |
|
| 24 |
+ model_name='modelinfo', |
|
| 25 |
+ name='factory_yuan', |
|
| 26 |
+ ), |
|
| 27 |
+ migrations.RemoveField( |
|
| 28 |
+ model_name='modelinfo', |
|
| 29 |
+ name='warehouse', |
|
| 30 |
+ ), |
|
| 31 |
+ migrations.AddField( |
|
| 32 |
+ model_name='modelinfo', |
|
| 33 |
+ name='model_uni_full_name', |
|
| 34 |
+ field=models.CharField(blank=True, help_text='型号统一全名称', max_length=255, null=True, verbose_name='model_uni_full_name'), |
|
| 35 |
+ ), |
|
| 36 |
+ ] |
@@ -162,21 +162,16 @@ class ModelInfo(BaseModelMixin): |
||
| 162 | 162 |
model_id = ShortUUIDField(_(u'model_id'), max_length=32, help_text=u'型号唯一标识', db_index=True, unique=True) |
| 163 | 163 |
model_name = models.CharField(_(u'model_name'), max_length=32, blank=True, null=True, help_text=u'型号名称') |
| 164 | 164 |
model_uni_name = models.CharField(_(u'model_uni_name'), max_length=32, blank=True, null=True, help_text=u'型号统一名称') |
| 165 |
+ model_uni_full_name = models.CharField(_(u'model_uni_full_name'), max_length=255, blank=True, null=True, help_text=u'型号统一全名称') |
|
| 165 | 166 |
model_full_name = models.CharField(_(u'model_full_name'), max_length=255, blank=True, null=True, help_text=u'型号全名称') |
| 166 | 167 |
model_descr = models.TextField(_(u'model_descr'), max_length=255, blank=True, null=True, help_text=u'型号描述') |
| 167 | 168 |
model_mount = models.CharField(_(u'model_mount'), max_length=32, choices=MOUNT_TUPLE, default='SONY', help_text=u'镜头卡口') |
| 168 | 169 |
|
| 169 |
- category = models.CharField(_(u'category'), max_length=32, blank=True, null=True, help_text=u'型号类别', db_index=True) |
|
| 170 |
- warehouse = models.CharField(_(u'warehouse'), max_length=32, blank=True, null=True, help_text=u'所属仓库', db_index=True) |
|
| 171 |
- |
|
| 172 | 170 |
image = models.ImageField(_(u'image'), upload_to=upload_path, blank=True, null=True, help_text=u'横图') |
| 173 | 171 |
url = models.CharField(_(u'url'), max_length=255, blank=True, null=True, help_text=u'链接') |
| 174 | 172 |
|
| 175 | 173 |
image2 = models.ImageField(_(u'image2'), upload_to=upload_path, blank=True, null=True, help_text=u'方图') |
| 176 | 174 |
|
| 177 |
- factory_yuan = models.FloatField(_(u'factory_yuan'), default=1000, help_text=u'出厂价(元)') |
|
| 178 |
- factory_fee = models.IntegerField(_(u'factory_fee'), default=100000, help_text=u'出厂价(分)') |
|
| 179 |
- |
|
| 180 | 175 |
integral = models.IntegerField(_(u'integral'), default=100, help_text=u'【销售员】卡路里') |
| 181 | 176 |
|
| 182 | 177 |
position = models.IntegerField(_(u'position'), default=1, help_text=u'排序') |
@@ -257,13 +252,10 @@ class ModelInfo(BaseModelMixin): |
||
| 257 | 252 |
'model_uni_name': self.model_uni_name, |
| 258 | 253 |
'model_full_name': self.model_full_name, |
| 259 | 254 |
'model_descr': self.model_descr, |
| 260 |
- 'category': self.category, |
|
| 261 |
- 'warehouse': self.warehouse, |
|
| 262 | 255 |
'image_path': self.image_path, |
| 263 | 256 |
'image_url': self.image_url, |
| 264 | 257 |
'image2_path': self.image2_path, |
| 265 | 258 |
'image2_url': self.image2_url, |
| 266 |
- 'factory_yuan': self.factory_yuan, |
|
| 267 | 259 |
'integral': self.integral, |
| 268 | 260 |
'is_important': self.is_important, |
| 269 | 261 |
} |
@@ -327,7 +327,7 @@ class ShotTypeInfo(BaseModelMixin, BrandInfoMixin): |
||
| 327 | 327 |
|
| 328 | 328 |
@property |
| 329 | 329 |
def shots(self): |
| 330 |
- models = ModelInfo.objects.filter(shot_type_id=self.shot_type_id, status=True, is_show_shot=True) |
|
| 330 |
+ models = ModelInfo.objects.filter(shot_type_id=self.shot_type_id, status=True, is_show_shot=True).order_by('-pk')
|
|
| 331 | 331 |
return [model.member_shot_data for model in models] |
| 332 | 332 |
|
| 333 | 333 |
@property |